import {funderType, funderStatus, productStatus, channelStatus, authorizionStatus, channelproductStatus, yesOrNo, loadStatus, platform,orderStatus, stageStatus, orderStage} from "@/utils/enum.js"

const userTagtype = (row) => { return row.status === 0 ? '禁用' : "正常"}
const getStatus = (row, status, key) => { return (status||[]).filter(item => item.value == row[key])[0]?.label||'--'}
const productTagtyp = (row, key) => { return ['2','3'].includes(row[key]) ? "success" : "danger"}
const channelTagtype = (row, key) => { return ['1'].includes(row[key]) ? "success" : "danger"}

// 进件订单列表状态
export default {
  dataCoverage: [
    { label: '数据涵盖名称', prop: 'name', type: 'input', show: true},
    { label: '标识', prop: 'parentName', type: 'input',  width: 200, show: true },
    { label: '状态', prop: 'icon', type: 'input',  width: 180, show: true },
    { label: '更新时间', prop: 'type', type: 'select', show: true  },
  ],
  dataProviderList: [
    { label: '公司名称', prop: 'name', type: 'input', width: 200, show: true},
    { label: '数据涵盖', prop: 'parentName', type: 'input',  width: 200, show: true },
    { label: '联系人', prop: 'icon', type: 'input',  width: 180, show: true },
    { label: '联系电话', prop: 'type', type: 'input', width: 180, show: true },
    { label: '优先级', prop: 'type', type: 'select', show: true },
    { label: '状态', prop: 'type', type: 'select', show: true },
    { label: '单价（元）', prop: 'type', type: 'input', width: 180,show: true },
    { label: '价格说明', prop: 'type', type: 'input', width: 230,show: true },
  ],
  dataMerchantCall: [
    { label: '数据商名称', prop: 'name', type: 'input', show: true},
    { label: '统计调用次数', prop: 'name', type: 'input', show: true},
    { label: '统计调用费用（元）', prop: 'name', type: 'input', show: true},
  ],
  interfaceCall: [
    { label: '数据商名称', prop: 'name', type: 'input', show: true},
    { label: '所属涵盖', prop: 'name', type: 'input', show: true},
    { label: '接口名称', prop: 'name', type: 'input', show: true},
    { label: '响应状态', prop: 'name', type: 'input', show: true},
    { label: '数据状态', prop: 'name', type: 'input', show: true},
    { label: '数据说明', prop: 'name', type: 'input', show: true},
    { label: '请求时间', prop: 'name', type: 'input', show: true},
    { label: '响应时长（毫秒）', prop: 'name', type: 'input', show: true},
  ],
  funderManage: [
    { label: '资金方名称', prop: 'fundName', type: 'input', show: true},
    { label: '资金方简称', prop: 'fundShorterForm', type: 'input', show: true},
    { label: '排序', prop: 'fundSort', type: 'input', show: true},
    { label: '机构代码', prop: 'creditCode', type: 'input', show: true},
    { label: '分类', prop: 'fundType', type: 'input', show: true, formatter: (row)=> {return funderType.filter(item => item.value == row.fundType)[0]?.label}},
    { label: '服务区域', prop: 'serviceArea', type: 'input', show: true},
    { label: '状态', prop: 'fundStatus', type: 'tag', show: true, formatter: (row) => getStatus(row, funderStatus, "fundStatus"), tagType: (row) => productTagtyp(row, "fundStatus")},
  ],
  productClass: [
    { label: '产品分类名称', prop: 'productCategoryName', type: 'input', show: true},
    { label: '状态', prop: 'productCategoryStatus', type: 'tag', show: true, formatter: (row) => getStatus(row, funderStatus, "productCategoryStatus"), tagType:(row) => productTagtyp(row, "productCategoryStatus"),},
    { label: '备注', prop: 'productCategoryNote', type: 'input', show: true},
    { label: '更新时间', prop: 'updateTime', type: 'input', show: true},
  ],
  productManage: [
    { label: '产品编号', prop: 'productNum', type: 'input', show: true},
    { label: '产品名称', prop: 'productName', type: 'input', show: true},
    { label: '产品简称', prop: 'productShotName', type: 'input', show: true},
    { label: '分类', prop: 'productCategoryName', type: 'input', show: true},
    { label: '资金方', prop: 'fundName', type: 'input', show: true},
    { label: '状态', prop: 'productStatus', type: 'tag', show: true, formatter: (row) => getStatus(row, productStatus, "productStatus"), tagType: (row) => productTagtyp(row, "productStatus")},
    { label: '更新时间', prop: 'updateTime', type: 'input', show: true},
  ],
  channelInfo: [
    { label: '渠道代码', prop: 'channelCode', type: 'input',width: 160, show: true},
    { label: '渠道名称', prop: 'channelName', type: 'input',width: 200, show: true},
    { label: '地区', prop: 'areaCode', type: 'input', show: true},
    { label: '合作开始时间', prop: 'cooperateStartTime', type: 'input', width: 160, show: true},
    { label: '合作终止时间', prop: 'cooperateEndTime', type: 'input', width: 160, show: true},
    { label: '联系人', prop: 'contacts', type: 'input', show: true},
    { label: '联系电话', prop: 'contactTel', type: 'input',width: 160, show: true},
    { label: '状态', prop: 'dataStatus', type: 'tag', show: true, formatter: (row) => getStatus(row, channelStatus, "dataStatus"), tagType: (row) => channelTagtype(row, "dataStatus")},
    { label: '状态更新时间', prop: 'updateTime', type: 'input', width: 160, show: true},
  ],
  authorizationAgreement: [
    { label: '文件编号', prop: 'agreementCode', type: 'input', show: true},
    { label: '文件名称', prop: 'agreementName', type: 'input', show: true},
    { label: '简要概述', prop: 'agreementSummary', type: 'input', show: true},
    { label: '版本号', prop: 'version', type: 'input', show: true},
    { label: '状态', prop: 'status', type: 'input', show: true, formatter: (row) => getStatus(row, authorizionStatus, "status")},
    { label: '更新时间', prop: 'createTime', type: 'input', show: true},
  ],
  channelProduct: [
    { label: '产品邀请码', prop: 'inviteCode', type: 'input', show: true},
    { label: '渠道名称', prop: 'channelName', type: 'input', show: true},
    { label: '产品名称', prop: 'productName', type: 'input', show: true},
    { label: '协议数量', prop: 'agreementNum', type: 'input', show: true},
    { label: '地区', prop: 'areaCode', type: 'input', show: true},
    { label: '联系人', prop: 'contacts', type: 'input', show: true},
    { label: '联系电话', prop: 'contactTel', type: 'input', show: true},
    { label: '状态', prop: 'status', type: 'input', show: true, formatter: (row) => getStatus(row, channelproductStatus, "status")},
    { label: '更新时间', prop: 'createTime', type: 'input', show: true},
  ],
  incomingOrdersList: [
    { label: '订单编号', prop: 'orderNum', type: 'input', show: true, width:"180px"},
    { label: '企业名称', prop: 'custName', type: 'input', show: true, width:"280px"},
    { label: '统一社会信用代码', prop: 'idNo', type: 'input', show: true, width:"180px"},
    { label: '企业省市', prop: 'eprovinceCity', type: 'input', show: true, width:"100px"},
    { label: '电商平台', prop: 'ebusinessPlatform', type: 'input', show: true, width:"100px",formatter: (row) => getStatus(row, platform, "ebusinessPlatform") },
    { label: '开店日期', prop: 'eplatformStartDate', type: 'input', show: true, width:"100px"},
    { label: '渠道名称', prop: 'channelName', type: 'input', show: true, width:"150px"},
    { label: '产品名称', prop: 'productName', type: 'input', show: true,width:"150px"},
    { label: '收单时间', prop: 'createTime', type: 'input', show: true, width:"160px"},
    { label: '数据支持', prop: 'ifDataSupport', type: 'input', show: true, formatter: (row) => getStatus(row, yesOrNo, "ifDataSupport"), width:"100px"},
    { label: '订单阶段', prop: 'orderStage', type: 'input', show: true ,formatter: (row) => getStatus(row, orderStage, "orderStage"), width:"100px"},
    { label: '阶段状态', prop: 'stageStatus', type: 'input', show: true,formatter: (row) => getStatus(row, stageStatus, "stageStatus"), width:"100px"}, 
    { label: '订单状态', prop: 'orderStatus', type: 'input', show: true,formatter: (row) => getStatus(row, orderStatus, "orderStatus"), width:"100px"},
  ],
  dataAuthorization: [
    { label: '订单编号', prop: 'orderCode', type: 'input', show: true, width:"180px"},
    { label: '企业名称', prop: 'custName', type: 'input', show: true, width:"260px"},
    { label: '统一社会信用代码', prop: 'idNo', type: 'input', show: true, width:"200px"},
    { label: '企业省市', prop: 'eprovinceCity', type: 'input', show: true, width:"150px"},
    { label: '电商平台', prop: 'ebusinessPlatform', type: 'input', show: true, formatter: (row) => getStatus(row, platform, "ebusinessPlatform"), width:"100px"},
    { label: '开店日期', prop: 'eplatformStartDate', type: 'input', show: true, width:"100px"},
    { label: '渠道名称', prop: 'channelName', type: 'input', show: true, width:"150px"},
    { label: '产品名称', prop: 'productName', type: 'input', show: true, width:"150px"},
    { label: '授权时间', prop: 'createTime', type: 'input', show: true, width:"160px"},
    { label: '授权文件', prop: 'agreementNames', type: 'input', show: true, width:"200px"}
  ],
  loanAcceptance: [
    { label: '订单编号', prop: 'orderNum', type: 'input', show: true},
    { label: '客户企业名称', prop: 'custName', type: 'input', show: true},
    { label: '客户统一社会信用代码', prop: 'idNo', type: 'input', show: true},
    { label: '客户企业省市', prop: 'eprovinceCity', type: 'input', show: true},
    { label: '所属电商平台', prop: 'ebusinessPlatform', type: 'input', show: true, formatter: (row) => getStatus(row, platform, "ebusinessPlatform")},
    { label: '开店日期', prop: 'eplatformStartDate', type: 'input', show: true},
    { label: '渠道名称', prop: 'channelName', type: 'input', show: true},
    { label: '产品名称', prop: 'productName', type: 'input', show: true},
    { label: '收单时间', prop: 'createTime', type: 'input', show: true},
    { label: '是否需要数据支持', prop: 'ifDataSupport', type: 'input', show: true, formatter: (row) => getStatus(row, yesOrNo, "ifDataSupport")},
    { label: '订单状态', prop: 'orderStatus', type: 'input', show: true, formatter: (row) => getStatus(row, orderStatus, "orderStatus")},
    { label: '阶段状态', prop: 'stageStatus', type: 'input', show: true,formatter: (row) => getStatus(row, stageStatus, "stageStatus"), width:"100px"}, 

    // { label: '数据状态', prop: 'name', type: 'input', show: true},
    // { label: '放款状态', prop: 'name', type: 'input', show: true},
  ],
  loanList: [
    { label: '订单编号', prop: 'name', type: 'input', show: true},
    { label: '客户企业名称', prop: 'name', type: 'input', show: true},
    { label: '客户统一社会信用代码', prop: 'name', type: 'input', show: true},
    { label: '客户企业省市', prop: 'name', type: 'input', show: true},
    { label: '所属电商平台', prop: 'name', type: 'input', show: true},
    { label: '开店日期', prop: 'name', type: 'input', show: true},
    { label: '渠道名称', prop: 'name', type: 'input', show: true},
    { label: '产品名称', prop: 'name', type: 'input', show: true},
    { label: '收单时间', prop: 'name', type: 'input', show: true},
    { label: '是否需要数据支持', prop: 'name', type: 'input', show: true},
    { label: '订单状态', prop: 'name', type: 'input', show: true},
    { label: '数据状态', prop: 'name', type: 'input', show: true},
    { label: '放款状态', prop: 'name', type: 'input', show: true},
  ],
  user: [
    { label: 'ID', prop: 'userId', type: 'input', show: true},
    { label: '用户名', prop: 'username', type: 'input', show: true},
    { label: '邮箱', prop: 'email', type: 'input', show: true},
    { label: '手机号', prop: 'mobile', type: 'input', show: true},
    { label: '状态', prop: 'status', type: 'tag', show: true, formatter: userTagtype, tagType: (row) => {return row.status === 0 ? "danger" : "success"}}, 
    { label: '创建时间', prop: 'createTime', type: 'input', show: true},
  ],
  role: [
    { label: 'ID', prop: 'roleId', type: 'input', show: true},
    { label: '角色名称', prop: 'roleName', type: 'input', show: true},
    { label: '备注', prop: 'remark', type: 'input', show: true},
    { label: '创建时间', prop: 'createTime', type: 'input', show: true},
  ]
}

